/*****************************************************************************
	File Name:			Player.h
	Authors:			Marc Willis, Trey Turley, Thomas Lee
	Class Name:			Player
	Description:		Describes a player in the game Tron.  A pure virtual
						class, designed to be used with HPlayer and AIPlayer
	Date Modified:		08/07/2010
						-Modifed to contain a pointer to the GameMap the
						 player will be on, added advance function
						08/01/2010
						-File Created
*****************************************************************************/

#ifndef PLAYER_H
#define PLAYER_H

#include "keyboard.h"
#include "GameMap.h"

const int DIR_LEFT=1;
const int DIR_UP=2;
const int DIR_RIGHT=3;
const int DIR_DOWN=4;

class Player
{
protected:
	int x,y,dir,color;  //x,y,direction, and color of the player
	GameMap *gm;
	bool alive;
public:
/*****************************************************************************
	Function Name:		Player()
	Description:		Default constructor for the Player class, creates a
						Player with default stats
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	Player();
/*****************************************************************************
	Function Name:		Player(int,int,int,int,GameMap&)
	Description:		Constructor for the Player class, creates a Player
						with the given stats
	Input:
		int x			x of the player
		int y			y of the player
		int dir			direction of the player
		int color		color of the player
		GameMap &g		GameMap to be referenced
	Output:
		(none)
*****************************************************************************/
	Player(int,int,int,int,GameMap&);
/*****************************************************************************
	Function Name:		refreshDir()
	Description:		Sets the next direction; each child will have a
						different method of doing this.
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	virtual void refreshDir()=0;
/*****************************************************************************
	Function Name:		advance()
	Description:		Advances the player in the map.
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	void advance();
/*****************************************************************************
	Function Name:		getColor()
	Description:		Gets the color of the player  
	Input:
		(none)
	Output:
		int				the player's color
*****************************************************************************/
	int getColor();
/*****************************************************************************
	Function Name:		getDir()
	Description:		Gets the direction of the player  
	Input:
		(none)
	Output:
		int				the player's direction
*****************************************************************************/
	int getDir();
/*****************************************************************************
	Function Name:		getX()
	Description:		Gets the x coordinate of the player  
	Input:
		(none)
	Output:
		int				the player's x
*****************************************************************************/
	int getX();
/*****************************************************************************
	Function Name:		getY()
	Description:		Gets the y coordinate of the player  
	Input:
		(none)
	Output:
		int				the player's y
*****************************************************************************/
	int getY();
/*****************************************************************************
	Function Name:		setX(int)
	Description:		Sets the x coordinate of the player  
	Input:
		int n			the player's new x
	Output:
		(none)
*****************************************************************************/
	void setX(int);
/*****************************************************************************
	Function Name:		setY(int)
	Description:		Sets the y coordinate of the player  
	Input:
		int n			the player's new y
	Output:
		(none)
*****************************************************************************/
	void setY(int);
/*****************************************************************************
	Function Name:		isAlive()
	Description:		Gets alive value for the player
	Input:
		(none)
	Output:
		bool			the player's alive status
*****************************************************************************/
	bool isAlive();
/*****************************************************************************
	Function Name:		setAlive(bool)
	Description:		sets alive value for the player
	Input:
		bool a			the player's alive status	
	Output:
		(none)
*****************************************************************************/
	void setAlive(bool);
/*****************************************************************************
	Function Name:		setOpponent(Player*)
	Description:		sets the AI's opponent (only used in zero-player mode)
	Input:
		Player *p		a pointer to the opponent
	Output:
		(none)
*****************************************************************************/
	virtual void setOpponent(Player*){}
};

#endif
